package com.ruoyi.system.service.impl;

import java.util.Date;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.TablePassCardOperationLogMapper;
import com.ruoyi.system.domain.TablePassCardOperationLog;
import com.ruoyi.system.service.ITablePassCardOperationLogService;

/**
 * 桌台次卡操作记录，记录次卡全生命周期的操作日志及变更追踪Service业务层处理
 *
 * @author ruoyi
 * @date 2025-05-21
 */
@Service
public class TablePassCardOperationLogServiceImpl implements ITablePassCardOperationLogService
{
    @Autowired
    private TablePassCardOperationLogMapper tablePassCardOperationLogMapper;

    /**
     * 通过id查询桌台次卡操作记录
     *
     * @param id 桌台次卡操作记录，记录次卡全生命周期的操作日志及变更追踪主键
     * @return 桌台次卡操作记录，记录次卡全生命周期的操作日志及变更追踪
     */
    @Override
    public TablePassCardOperationLog selectTablePassCardOperationLogById(Long id)
    {
        return tablePassCardOperationLogMapper.selectTablePassCardOperationLogById(id);
    }

    /**
     * 查询桌台次卡操作记录列表
     *
     * @param  operationType,passCardCode,operationStartTime,operationEndTime 操作类型，桌台次卡编码，操作开始时间，操作结束时间
     * @return 桌台次卡操作记录，记录次卡全生命周期的操作日志及变更追踪
     */
    @Override
    public List<TablePassCardOperationLog> selectTablePassCardOperationLogListByConditions(String operationType, String passCardCode, Date operationStartTime, Date operationEndTime)
    {
        return tablePassCardOperationLogMapper.selectTablePassCardOperationLogListByConditions(operationType,passCardCode,operationStartTime,operationEndTime);
    }

    /**
     * 新增桌台次卡操作记录
     *
     * @param tablePassCardOperationLog 桌台次卡操作记录，记录次卡全生命周期的操作日志及变更追踪
     * @return 结果
     */
    @Override
    public int insertTablePassCardOperationLog(TablePassCardOperationLog tablePassCardOperationLog)
    {
        tablePassCardOperationLog.setCreateTime(DateUtils.getNowDate());
        return tablePassCardOperationLogMapper.insertTablePassCardOperationLog(tablePassCardOperationLog);
    }

    /**
     * 修改桌台次卡操作记录
     *
     * @param tablePassCardOperationLog 桌台次卡操作记录，记录次卡全生命周期的操作日志及变更追踪
     * @return 结果
     */
    @Override
    public int updateTablePassCardOperationLog(TablePassCardOperationLog tablePassCardOperationLog)
    {
        return tablePassCardOperationLogMapper.updateTablePassCardOperationLog(tablePassCardOperationLog);
    }

    /**
     * 通过id批量删除桌台次卡操作记录信息
     *
     * @param ids 需要删除的桌台次卡操作记录，记录次卡全生命周期的操作日志及变更追踪主键
     * @return 结果
     */
    @Override
    public int deleteTablePassCardOperationLogByIds(Long[] ids)
    {
        return tablePassCardOperationLogMapper.deleteTablePassCardOperationLogByIds(ids);
    }

    /**
     * 通过id删除桌台次卡操作记录信息
     *
     * @param id 桌台次卡操作记录，记录次卡全生命周期的操作日志及变更追踪主键
     * @return 结果
     */
    @Override
    public int deleteTablePassCardOperationLogById(Long id)
    {
        return tablePassCardOperationLogMapper.deleteTablePassCardOperationLogById(id);
    }
}
